#include <bits/stdc++.h>
using namespace std;
const int maxn = 10000+5;
typedef pair<int, int> pii;

int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);

    int n, m;
    while(cin >> n >> m){
        vector<int> d[n];
        int r1, r2, c1, c2;
        map<string, int> id;
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            string in; getline(cin, in);
            while(in.empty()) getline(cin, in);
            int p = 0, np = 0;
            do{
                np = in.find(',', p);
                string t;
                if(np == -1) t = in.substr(p);
                else t = in.substr(p, np-p);
                int tid;
                if(id.count(t)) tid = id[t];
                else {
                    tid = ++cnt;
                    id[t] = tid;
                }
                d[i].push_back(tid);

                p = np+1;
            }while(np != -1);
        }

        bool Find = false;
        for (int i = 0; i < m; ++i) {
            for (int j = i+1; j < m; ++j) {
                map<pii, int> row;
                for (int k = 0; k < n; ++k) {
                    pii t = make_pair(d[k][i], d[k][j]);
                    if(!row.count(t)) row[t] = k;
                    else{
                        r1 = row[t]+1; r2 = k+1;
                        c1 = i+1; c2 = j+1;
                        Find = true;
                        goto END;
                    }
                }
            }
        }
        END:
        if(!Find) cout << "YES\n";
        else{
            cout << "NO\n";
            cout << r1 << " " << r2 << "\n";
            cout << c1 << " " << c2 << "\n";
        }
    }

    return 0;
}